package br.unip.tcc.domotic.orm;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "tipo_operador")
public class OperatorType extends AbstractORM {
	
	private static final long serialVersionUID = 1L;
	
	private Integer operatorTypeId;
	private String operatorTypeDescription;
	private String operatorTypeSymbol;
	private Set<Condition> conditions = new HashSet<Condition>(0);
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "cod_tipo_operador", unique = true, nullable = false)
	public Integer getOperatorTypeId() {
		return operatorTypeId;
	}
	
	public void setOperatorTypeId(Integer operatorTypeId) {
		this.operatorTypeId = operatorTypeId;
	}
	
	@Column(name = "des_tipo_operador", nullable = false)
	public String getOperatorTypeDescription() {
		return operatorTypeDescription;
	}
	
	public void setOperatorTypeDescription(String operatorTypeDescription) {
		this.operatorTypeDescription = operatorTypeDescription;
	}
	
	@Column(name = "smb_tipo_operador", nullable = false)
	public String getOperatorTypeSymbol() {
		return operatorTypeSymbol;
	}
	
	public void setOperatorTypeSymbol(String operatorTypeSymbol) {
		this.operatorTypeSymbol = operatorTypeSymbol;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "operatorType")
	public Set<Condition> getConditions() {
		return conditions;
	}
	
	public void setConditions(Set<Condition> conditions) {
		this.conditions = conditions;
	}
	
}
